#ifndef MOVEMANAGER_H
#define MOVEMANAGER_H

#include <OIS/OISMouse.h>
#include <OIS/OISKeyboard.h>
#include <OIS/OISJoyStick.h>
#include <OGRE/OgreNode.h>

namespace Viewer {
    
class MoveManager
{
public:
    MoveManager(Ogre::Node* node, OIS::Keyboard* kbd, OIS::JoyStick* js);
    ~MoveManager();
    
    bool mouseMoved(const OIS::MouseEvent &arg);
    bool mousePressed(const OIS::MouseEvent &arg, OIS::MouseButtonID id);
    bool mouseReleased(const OIS::MouseEvent &arg, OIS::MouseButtonID id);
    
    bool keyPressed( const OIS::KeyEvent &arg );
    bool keyReleased( const OIS::KeyEvent &arg );
    
    bool axisMoved(const OIS::JoyStickEvent &arg, int axis);
    
    void nextFrame(const Ogre::FrameEvent& evt);
    
private:
    Ogre::Node* _node;
    Ogre::Vector2 _direction;
    
    OIS::Keyboard* _keyboard;
    OIS::JoyStick* _joystick;
    
    bool _keyUp, _keyDown, _keyLeft, _keyRight;
};

}

#endif // MOVEMANAGER_H
